package lzm;

public class User {

    public User() {

        System.out.println("通过默认构造器创建对象User");

    }

    private String name;

    private int age;

    private Teacher teacher;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", teacher=" + teacher +
                '}';
    }

    public Teacher getTeacher() {
        return teacher;
    }

    public void initMethod() {

        System.out.println("User initMethod");
    }

    public void setTeacher(Teacher teacher) {
        this.teacher = teacher;
    }
}
